package com.pqc.tbk.service.account;

import com.pqc.tbk.entity.account.User;

public interface UserService {

	void delete(User user);

	void update(User user);

	User checkLogin(String username, String password);

	User findByUserName(String username);

	User findByEmail(String email);

	boolean exist(String username);

	boolean existEmail(final String email);

	void regist(User user, String inviter);

	User findUser(Long id);

	boolean updatePwd(String oPwd, String nPwd, Long id);

	boolean updateBasicInfo(User user, Long id);

	int emailVerify(String email, Long t, String sign);

	/**
	 * 绑定信息时候判断该号码是否已经绑定了
	 * 
	 * @author zl
	 * @param tel
	 * @return
	 */
	int countByTel(String tel);

	/**
	 * 向手机发送验证码
	 * 
	 * @return 返回验证码
	 * @throws Exception
	 */
	String sendMsg(String mobile) throws Exception;

	/**
	 * 将手机号码绑定
	 * 
	 * @param tel
	 */
	void bindTel(String tel);

	/**
	 * 判断支付宝账户是否已经和其它用户绑定了
	 * 
	 * @param alipay
	 * @return
	 */
	int countByAlipay(String alipay);

	/**
	 * 为用户绑定支付宝账户
	 * 
	 * @param alipay
	 */
	void bindAlipay(String alipay);
}
